
# CFLAGS := -std=gnu99 -static
CFLAGS := -std=gnu99 -Werror
CFLAGS += -static
CFLAGS += -O0

build:
	# gcc $(CFLAGS) spectre-v1.c -o spectre-v1.x86.elf
	# gcc $(CFLAGS) spectre-v4.c -o spectre-v4.x86.elf
	# gcc $(CFLAGS) meltdown-v3.c -o meltdown-v3.x86.elf
	# gcc $(CFLAGS) meltdown.c -o meltdown.x86.elf

	# aarch64-linux-gnu-gcc $(CFLAGS) meltdown.c -o meltdown.aarch64.elf
	# aarch64-linux-gnu-gcc $(CFLAGS) meltdown-1.c -o meltdown-1.aarch64.elf
	aarch64-linux-gnu-gcc $(CFLAGS) spectre-v1.c -o spectre-v1.a64.elf
	aarch64-linux-gnu-gcc $(CFLAGS) spectre-v4.c -o spectre-v4.a64.elf
	aarch64-linux-gnu-gcc $(CFLAGS) meltdown-v3a.c -o meltdown-v3a.a64.elf
	aarch64-linux-gnu-gcc $(CFLAGS) meltdown-v3.c -o meltdown-v3.a64.elf

	arm-none-linux-gnueabihf-gcc $(CFLAGS) spectre-v1.c -o spectre-v1.a32.elf
	arm-none-linux-gnueabihf-gcc $(CFLAGS) spectre-v4.c -o spectre-v4.a32.elf
	arm-none-linux-gnueabihf-gcc $(CFLAGS) meltdown-v3a.c -o meltdown-v3a.a32.elf
	arm-none-linux-gnueabihf-gcc $(CFLAGS) meltdown-v3.c -o meltdown-v3.a32.elf
	
	cp *aarch64.elf tt/

clean:
	rm *.elf -f
	